﻿<ul class="nav pull-right">
    @{
        Hetang.Models.Interface.ISessionRepository _sr = new Hetang.Models.Repository.SessionRepository();
        if (this.Request.IsAuthenticated)
        {
            if (_sr.GetUserId() <= 0)
            {
        <li>@Html.ActionLink("注册", "index", "signup", new { area = "" }, null)</li>
        <li>@Html.ActionLink("登录", "index", "login", new { area = "" }, null)</li>
            }
            else
            {
                foreach (Hetang.Models.Config.UserType u in Enum.GetValues(typeof(Hetang.Models.Config.UserType)))
                {
                    if (_sr.GetUserType().Equals(u))
                    {
        <li>@Html.ActionLink(_sr.GetUserName(), "index", "account", new { area = "user" }, null)</li>
                    }
                }
        <li>@Html.ActionLink("退出", "index", "logout", new { area = "" }, null)</li>
            }
        }
        else
        {
        <li>@Html.ActionLink("注册", "index", "signup", new { area = "" }, null)</li>
        <li>@Html.ActionLink("登录", "index", "login", new { area = "" }, null)</li>
        
            if (_sr.GetUserId() <= 0)
            {
                _sr.ClearSession();
            }
        }
    }
</ul>
